﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_BOM_PRODUCT_BOM_MATERIAL
// * CreateDate    : 2012/4/20 15:18:41
// * Creater       : CodeSmith
// * LastChangeDate: 2012/4/20 15:18:41
// * LastChanger   : 2012/4/20 15:18:41
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class BomProductBomMaterialEntity : EntityBase
    {
        public BomProductBomMaterialTable TableSchema
        {
            get
            {
                return BomProductBomMaterialTable.Current;
            }
        }

        public BomProductBomMaterialEntity()
        {

        }

        public BomProductBomMaterialEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.BomMaterialId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_MATERIAL_ID"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
            this.ManufacturingType = Convert.ToString(CommonFunctions.ToObject(dr["MANUFACTURING_TYPE"]));
            this.PickingModel = Convert.ToDecimal(CommonFunctions.ToObject(dr["PICKING_MODEL"]));
            this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
            this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
            this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public BomProductBomMaterialEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.BomMaterialId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_MATERIAL_ID"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
            this.ManufacturingType = Convert.ToString(CommonFunctions.ToObject(dr["MANUFACTURING_TYPE"]));
            this.PickingModel = Convert.ToDecimal(CommonFunctions.ToObject(dr["PICKING_MODEL"]));
            this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
            this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
            this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
            this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return BomProductBomMaterialTable.Current;
            }
        }

        #region Perporty List
        public string BomMaterialId
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_BOM_MATERIAL_ID)); }
            set { SetData(BomProductBomMaterialTable.C_BOM_MATERIAL_ID, value); }
        }

        public string ProductId
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_PRODUCT_ID)); }
            set { SetData(BomProductBomMaterialTable.C_PRODUCT_ID, value); }
        }

        public string MaterialId
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_MATERIAL_ID)); }
            set { SetData(BomProductBomMaterialTable.C_MATERIAL_ID, value); }
        }

        public string ManufacturingType
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_MANUFACTURING_TYPE)); }
            set { SetData(BomProductBomMaterialTable.C_MANUFACTURING_TYPE, value); }
        }

        public decimal PickingModel
        {
            get { return Convert.ToDecimal(GetData(BomProductBomMaterialTable.C_PICKING_MODEL)); }
            set { SetData(BomProductBomMaterialTable.C_PICKING_MODEL, value); }
        }

        public string NetSize
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_NET_SIZE)); }
            set { SetData(BomProductBomMaterialTable.C_NET_SIZE, value); }
        }

        public string GrossSize
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_GROSS_SIZE)); }
            set { SetData(BomProductBomMaterialTable.C_GROSS_SIZE, value); }
        }

        public decimal UnitWeight
        {
            get { return Convert.ToDecimal(GetData(BomProductBomMaterialTable.C_UNIT_WEIGHT)); }
            set { SetData(BomProductBomMaterialTable.C_UNIT_WEIGHT, value); }
        }

        public string Remark
        {
            get { return Convert.ToString(GetData(BomProductBomMaterialTable.C_REMARK)); }
            set { SetData(BomProductBomMaterialTable.C_REMARK, value); }
        }

        #endregion
    }


}

